#include <iostream>
using namespace std;
class Base
{
public:
    Base(int i):x(i)
    {
        cout<<"Base CON"<<this<<endl;
    }
    ~Base()
    {
        cout<<"Base DES"<<this<<endl;
    }
    void show() const
    {
        cout<<"x= "<<x<< "\nx Adress= "<<this<<endl;
    }
protected:
    int x;
};
class Derived:public Base
{
public:
    Derived(int i):Base(i),d(i*7)
    {
        cout<<"Derived CON"<<this<<endl;
    }
    ~Derived()
    {
        cout<<"Derived DES"<<this<<endl;
    }
    void showValue()const
    {
        cout<<"===========类的继承信息=================="<<endl;
        cout<<"this->Base::x =" <<this->x<<endl;
        cout<<"this->Base::x Adress =" << &(this->x)<<endl;
        cout<<"===========类的组合信息=================="<<endl;
        d.show();
    }
private:
    Base d;
};
int main()
{
    cout<<"===========构造信息================"<<endl;
    Derived obj(5);
    obj.showValue();
    cout<<"==========析构信息================="<<endl;
}
